Port-Related Events
There are several port-related events that Open Transport can send to an application that is registered as an Open Transport client. Note that if your application is not registered as a client, Open Transport cannot send it these events.
enum { kOTPortDisabled = (OTEventCode)0x25000001, kOTPortEnabled = (OTEventCode)0x25000002, kOTYieldPortRequest = (OTEventCode)0x25000005, kOTNewPortRegistered = (OTEventCode)0x25000006, };Constant descriptions
- kOTPortDisabled
- A port has gone off line, as when the user removes a PCMCIA card while the computer is running. The
OTResult
parameter gives the specific reason, if known, and thecookie
parameter is the port reference of the port that went off line. A port going off line also often results in providers gettingkOTProviderIsClosed
events. There is no guarantee in Open Transport as to which of these events will be received first.- kOTPortEnabled
- A port that had previously been disabled is now reenabled, as when the user reinserts a previously removed PCMCIA card while the computer is running. The
cookie
parameter is the port reference of the port that is now enabled.- kOTYieldPortRequest
- You currently are using a provider that is using a port that some other application wants to use. The
OTResult
parameter is the reason for the request (normallykOTNoError
orkOTUserRequestedErr
), and thecookie
parameter is a pointer to anOTPortCloseStruct
structure.- kOTNewPortRegistered
- A new port has been registered with Open Transport, as when the user inserts a new PCMCIA card. The
cookie
parameter is the port reference of the new port. Your provider receives this event the first time a new port is enabled. Subsequently, if a port is reenabled after being disabled, you receive the kOTPortEnabled event instead.